const express = require("express");
const router = express.Router();
const expressJoi = require("@escook/express-joi")
const messageHandler = require('../router_handler/message')
const { reg_deparmentMessage_schema } = require("../schema/message")

router.post('/getAnnouncementManagement', messageHandler.getAnnouncementManagement)
router.post('/addAnnouncementManagement', messageHandler.addAnnouncementManagement)
router.post('/editAnnouncementManagement', messageHandler.editAnnouncementManagement)
router.post('/firstDeleteAnnouncementManagement', messageHandler.firstDeleteAnnouncementManagement)

router.post('/getSystemMessages', messageHandler.getSystemMessages)
router.post('/editSystemMessages', messageHandler.editSystemMessages)

router.post('/getRecycleBin', messageHandler.getRecycleBin)
router.post('/deleteRecycleBin', messageHandler.deleteRecycleBin)
router.post('/reductionRecycleBin', messageHandler.reductionRecycleBin)

// 获取未读信息id 
router.get('/getReadList', messageHandler.getReadList)
// 第一次设置未读信息
router.post('/changeReadList', messageHandler.changeReadList)
// 用户的部门的信息
router.post('/deparmentMessage', expressJoi(reg_deparmentMessage_schema), messageHandler.deparmentMessage)
// 信息阅读次数更改
router.post('/changeReadingTimes', messageHandler.changeReadingTimes)
// 删减当前用户的未阅读的信息
router.post('/deleteReadList', messageHandler.deleteReadList)
// 添加信息id当前用户的未阅读的信息
router.post('/addReadList', messageHandler.addReadList)

// 更改当前用户的未阅读的信息
router.post('/editReadList', messageHandler.editReadList)
module.exports = router